package shuati.shuzimali;

import java.util.Scanner;

/**
 * @author : LdLtd
 * @Date : 2024/4/15
 * @Description:abc三个数，哪个和x更接近，如果有多个输出same
 * 如 1 2 3 5
 * 输出C
 * 1  3  5  2
 * 输出same
 */
public class c2403 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=sc.nextInt();
        int x=sc.nextInt();
        a= Math.abs(x-a);
        b= Math.abs(x-b);
        c= Math.abs(x-c);
        int min = Math.min(Math.min(a, b), c);
        if(a==min&&b==min||a==min&&c==min||b==min&&c==min){
            System.out.println("same");
        }else{
            if(a==min){
                System.out.println("A");
            }else if(b==min){
                System.out.println("B");
            }else {
                System.out.println("C");
            }
        }
    }
}
